﻿@model MatchSummaryViewModel

<section>
    <div class="k-block grid_5 clearfix" id="saveMatch">

        <div class="k-header k-state-selected">Match action</div>  

        @if (Model.DbActionType == DbActionType.Deleted)
        {
            <div class="k-block k-success-colored">Match deleted.</div>
        }
        else
        {
            <section>
                <fieldset>
                    <legend>Create match</legend>

                    <div>
                        @Html.LabelFor(m => m.MatchDate)
                    </div>
                    <div>
                        @Html.TextBoxFor(m => m.MatchDate, new { @class = "k-textbox k-state-disabled", @readonly = "readonly" })
                    </div>

                    <div>
                        @Html.LabelFor(m => m.CompetitionName)
                    </div>
                    <div>
                        @Html.TextBoxFor(m => m.CompetitionName, new { @class = "k-textbox k-state-disabled", @readonly = "readonly" })
                    </div>

                    <div>
                        @Html.LabelFor(m => m.VenueName)
                    </div>
                    <div>
                        @Html.TextBoxFor(m => m.VenueName, new { @class = "k-textbox k-state-disabled", @readonly = "readonly" })
                    </div>

                    <div>
                        @Html.LabelFor(m => m.Team1Name)
                    </div>
                    <div>
                        @Html.TextBoxFor(m => m.Team1Name, new { @class = "k-textbox k-state-disabled", @readonly = "readonly" })
                    </div>

                    <div>
                        @Html.LabelFor(m => m.Team2Name)
                    </div>
                    <div>
                        @Html.TextBoxFor(m => m.Team2Name, new { @class = "k-textbox k-state-disabled", @readonly = "readonly" })
                    </div>

                    <div>
                        @Html.LabelFor(m => m.FullTimeScore)
                    </div>
                    <div>
                        @Html.TextBoxFor(m => m.FullTimeScore, new { @class = "k-textbox k-state-disabled", @readonly = "readonly" })
                    </div>

                    @switch (Model.DbActionType)
                    {
                        case DbActionType.Created:
                            <div class="k-block k-success-colored">New match saved.</div>
                            break;
                            
                        case DbActionType.Modified:
                            <div class="k-block k-success-colored">Match modified.</div>
                            break;
                            
                        case DbActionType.Approved:
                            <div class="k-block k-success-colored">Match approved.</div>
                            break;
                    }
                </fieldset>
            </section>
        }
            
        <span>@Html.ActionLink("Match search", "Index", "Search")</span>

    </div>
</section>
